#ifndef _DICOM_FILE_OBJECT_H_
#define _DICOM_FILE_OBJECT_H_

#include <string>
#include <stdint.h>
#include <json/json.h>
#include <gwbase/base/timestamp.h>

namespace dicom {

extern std::string GenFileId();

struct FileObject {
  std::string type;
  std::string cloud_id;
  std::string local_id;
  std::string name;
  dicom::Timestamp createTime;
  dicom::Timestamp modifiedTime;
  std::string creator;
  std::string parentId;
  int64_t size;
  bool star;
  bool is_delete;
  int svgPageCount;
  int metaV;
  std::string digest;  // md5
  int version;
  bool newDoc;
  std::string allParentId;
  bool isSepModified;
  std::string hex_key;

  FileObject();

  // following functions are used to send data
  // to client, so we use local_id
  std::string ToJson() const;
  void ToJson(Json::Value& v) const;

  // static bool Parse(const std::string& s, FileObject* fo);
};

struct DirObject {
  std::string type;
  std::string cloud_id;
  std::string local_id;
  std::string name;
  dicom::Timestamp createTime;
  dicom::Timestamp modifiedTime;
  std::string creator;
  std::string parentId;
  std::string allParentId;

  bool star;
  bool is_delete;
  bool share;
  int fileCount;

  DirObject();

  // following functions are used to send data
  // to client, so we use local_id
  std::string ToJson() const;
  void ToJson(Json::Value& v) const;

  // static bool Parse(const std::string& s, DirObject* d);
};
}

#endif  // _DICOM_FILE_OBJECT_H_
